package com.realone.packman.codec.decoder;

import com.realone.packman.codec.decoder.vo.BmsDecoderDataVoErrror;
import com.realone.packman.codec.exception.BmsDecoderException;

import java.nio.ByteBuffer;

/**
 * 错误应答
 *
 * @author hugx
 * @create 2018-09-12 16:16
 */
public class BmsDecoderFf extends BmsDecoder<BmsDecoderDataVoErrror> implements BmsDecoderStrategy {

    public BmsDecoderFf(Integer classType) {
       this.classType=classType;
    }

    @Override
    public BmsDecoderDataVoErrror decoderBody(ByteBuffer bb) {
        if (bb == null) {
            throw new BmsDecoderException(new NullPointerException());
        }

       return  new BmsDecoderDataVoErrror(this.classType,bb.get());
    }


}
